1. Field of the Invention
The present invention generally relates to techniques for processing graphical objects. More specifically, the present invention relates to a technique visually compositing one or more groups of objects in an image.
2. Related Art
Modern graphics processing units (GPUs) are configured to perform visual composite graphical objects in an image. During this compositing, when two or more of these graphical objects overlap, a GPU may determine an opacity for each overlapping object (which is sometimes referred to as alpha or an alpha value) that varies on a pixel-by-pixel basis.
However, when compositing multiple objects that overlap, semi-transparency of a group of composited objects may necessitate a second compositing operation. In particular, the GPU may first composite the objects based on the initial opacities of the objects. Subsequently, in order to cause the group to appear semi-transparent, the second compositing operation may be required to blend the group composition with any background.
For example, the image may include a fanned deck of cards, where each of the cards is a graphical object, and where a given card may at least partially obscure a portion of a card below it. Visually compositing the fanned deck of cards, as a group, on the image background is not a problem so long as the deck is opaque. However, if the deck is faded in or faded out as a group, the second compositing operation may be needed, because simply changing the opacity of each card will allow otherwise obscured portions of subsequent cards to bleed through the upper cards.
Unfortunately, this second compositing operation may delay the rendering of the image. Additionally, the second compositing operation may: consume GPU resources, increase memory usage, and/or increase bandwidth requirements.
Hence, what is needed is a technique that facilitates visual compositing of a group of graphical objects without the above-described problems.